<template>
	<view>
		<scroll-view scroll-y class="page">
			<!-- 头部 -->
			<cu-custom bgColor="bg-rgb" :isBack="true">
				<block slot="backText">返回</block>
				<block slot="content">拆分物料</block>
			</cu-custom>
			<!-- 查询条件 -->
			<view class="fixed" :style="[{animationDelay: 0.1 + 's'}]">
				<form>
					<view class="cu-form-group last">
						<image class="icon" src="../../static/saomiao.png" mode=""></image>
						<input auto-focus placeholder="请扫描条码" name="input" v-model="id"></input>
					</view>
					<view class="cu-form-group">
						<view class="title">打印张数：</view>
						<input placeholder="请输入打印张数" v-model="printNum"></input>
					</view>
					<view class="cu-form-group">
						<view class="title">物料数量：</view>
						<input placeholder="请输入物料数量" v-model="number"></input>
					</view>
					<view class="line">
					</view>
					<view class="btns">
						<view class="btn1" @click="print">打印</view>
					</view>
				</form>
				<view class="line">
				</view>
				<form>
					<view class="cu-form-group last">
						<image class="icon" src="../../static/saomiao.png" mode=""></image>
						<input auto-focus placeholder="请扫描条码" name="input" v-model="inputVal"></input>
					</view>
					<view class="line">
					</view>
					<view class="btns">
						<view class="btn1" @click="saomiao">扫描入库</view>
					</view>
				</form>
			</view>
			<!-- 数据列表 -->
		</scroll-view>
	</view>
</template>

<script>
	export default {
		name: 'zsTest',
		data() {
			return {
				id:'',
				printNum:'',
				number:'',
				inputVal:''
			}
		},
		methods: {
			// print
			print() {
				if (this.id.trim().length === 0) {
					this.modal.show({ type:'error', content:'请扫描二维码' })
					return
				}
				if (this.printNum.trim().length === 0) {
					this.modal.show({ type:'error', content:'请输入打印张数' })
					return
				}
				uni.showLoading({
					mask:true,
					title:'加载中.....'
				})
				this.$http.get('storage/mesStorageWholesale/inventoryPrinting', {
						params: {
							id:this.id,
							printNum:this.printNum,
							number:this.number,
						}
					}).then(res => {
						uni.hideLoading()
						if (res.data.success) {
							this.modal.show({ type:'success', content:res.data.message })
						} else {
							this.modal.show({ type:'error', content:res.data.message })
						}
					})
			},
			saomiao(){
				this.$http.get('storage/mesStorageWholesale/checkStockInById', {
						params: {
							id:this.inputVal,
						}
					}).then(res => {
						uni.hideLoading()
						if (res.data.success) {
							this.modal.show({ type:'success', content:res.data.message })
						} else {
							this.modal.show({ type:'error', content:res.data.message })
						}
					})
			}
		},
	}
</script>

<style lang="less">
	page {
		background-color: #f1f1f1;

		.fixed {
			position: fixed;
			z-index: 1;
			width: 100%;
			background-color: white;
			height: 100rpx;
			border-bottom: 1rpx solid #eee;

			.last {
				border-bottom: 1rpx solid #eee;
				position: relative;

				.icon {
					width: 30rpx;
					height: 29rpx;
					position: absolute;
					top: 36rpx;
					left: 60rpx;
				}

				input {
					width: 686rpx;
					height: 68rpx;
					background: #FFFFFF;
					border: 1px solid #D5D8DF;
					border-radius: 34px;
					padding-left: 79rpx;
				}
			}
		}

		.list {
			margin-top: 120rpx;

			.card {
				margin: 30rpx;
				box-shadow: 0px 0px 5rpx 2rpx rgba(0, 0, 0, 0.1);
				border-radius: 10rpx;
				background-color: white;

				.top {
					display: flex;
					align-items: center;
					justify-content: space-between;
					font-weight: bold;
					padding: 20rpx 30rpx;

					.left {
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: 400;
						color: #485A75;
						line-height: 50rpx;
					}

					.right {
						font-size: 28rpx;
						font-family: PingFang SC;
						font-weight: bold;
						color: #191919;
						line-height: 50rpx;
					}
				}

				.line {
					width: 750rpx;
					height: 10rpx;
					background: #F3F5F9;
				}

				.bottom {
					padding: 20rpx 30rpx;

					.box {
						display: flex;
						justify-content: space-between;
						padding: 20rpx 0;
						align-items: center;

						.lable {
							color: #485A75;
							font-size: 28rpx;
						}

						.content {
							width: 70%;
							text-align: right;
							color: #191919;
							font-weight: bold;
							word-break: break-all;
						}

						.shrink {
							height: 40rpx;
							overflow: hidden;
							white-space: nowrap;
							/*不换行*/
							text-overflow: ellipsis;
							/*超出部分文字以...显示*/
							font-weight: 400;
						}

						.unfold {
							text-align: left;
							font-weight: 400;
						}
					}
				}

				
			}
		}
	}
	.line {
		width: 750rpx;
		height: 10rpx;
		background: #F3F5F9;
	}
.btns {
					display: flex;
					justify-content: space-between;
					align-items: center;
					padding: 0 20rpx;
					font-size: 25rpx;
					padding: 20rpx 30rpx;
					background-color: #fff;

					view {
						width: 180rpx;
						height: 64rpx;
						line-height: 50rpx;
						color: white;
						border-radius: 30rpx;
						padding: 10rpx 20rpx;
						text-align: center;
					}

					.btn1 {
						// margin-left: 450rpx;
						background-image: radial-gradient(circle, #3F55E9, #5F71ED, #7D8CF0);
					}
				}
	.none .none1 {
		font-size: 30rpx;
		text-align: center;
		margin-top: 50rpx;
		color: #999999;
	}

	.none2 {
		font-size: 30rpx;
		text-align: center;
		margin-top: 50rpx;
		color: #999999;
	}

</style>
